package jgcp.master;

import java.net.Socket;
import java.util.concurrent.atomic.AtomicInteger;

import jgcp.common.network.Connection;
/**
 * 
 * @Date 31/05/2009
 * @author Jie Zhao (288654)
 * @version 1.0
 */
public class UserHandler extends Thread{
	final static AtomicInteger AI = new AtomicInteger(1);
	Connection con = new Connection();
	public UserHandler(Socket s)
	{
		con.setId(AI.getAndIncrement());
		con.setAddress(s.getInetAddress().getHostAddress());
		con.setName(s.getInetAddress().getHostName());
		con.setPort(s.getPort());
		con.setSocket(s);
	}
	public void run() {
		new MasterMessageHandler(con).start();
	}
}
